home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / comm2 / arfnwsb1.lha / bin / postnews.nntpput < prev    next >
Text File  |  1995-07-27  |  2KB  |  108 lines

  1. /*
  2. ** Postnews Replacement Script
  3. ** GRn Can Now Post News :-)
  4. */
  5. Parse arg result
  6. a = 1
  7. art = word(result,1)
  8. art2 = word(result,3)
  9. alreadyinsertedfile = "FALSE"
  10. org = "The Martin Hunt Fan Club"
  11. if open(org,"env:organization","R") then
  12. do
  13.    organisation = readln(org)
  14.    call close(org)
  15. end
  16.  
  17. if open(org,"env:user","R") then
  18. do
  19.    user = readln(org)
  20.    call close(org)
  21. end
  22.  
  23. if art2 ~="" then
  24. do
  25.   call open(file,art,"A")
  26.   call seek(file,0,"B")
  27.   newsgroup = readln(file)
  28.   a = 2
  29.   sig = 0
  30.   do while ~eof(file) & ~Sig
  31.     a = a + 1
  32.     if alreadyinsertedfile == "FALSE" then call insertfile2()
  33.     line.a = readln(file)
  34.     if compress(line.a) == "--" then call signature()
  35.     if upper(word(line.a,1)) == "FROM:" then a = a - 1
  36.   end
  37.   call close(file)
  38.   n = 1
  39.   quitflag = 0
  40.   do until quitflag
  41.      filename = "t:grn-file."||n
  42.      if ~exists(filename) then quitflag = 1
  43.      n = n + 1
  44.   end
  45.   art = filename
  46.   call open(file,art,"W")
  47.   call seek(file,0,"B")
  48.   line.1 = "From: "||user
  49.   line.2 = newsgroup
  50.   line.3 = "Organization: "||organisation
  51.   do i = 1 to a
  52.      call writeln(file,line.i)
  53.   end
  54.   call close(file)
  55. end
  56.  
  57. newsno = 0
  58. result1 = open(batchnews,"uuspool:newsno","A")
  59. if ~result1 then result2 = open(batchnews,"uuspool:newsno","W")
  60. call seek(batchnews,0,"B")
  61. if result1 then newsno=readln(batchnews)
  62. newsno = newsno + 1
  63. call seek(batchnews,0,"B")
  64. call writeln(batchnews,newsno)
  65. call close(batchnews)
  66.  
  67. newnewsfile = "uuspool:news."||newsno
  68. copycmd = "copy "||art||" to "||newnewsfile
  69. address command copycmd
  70. result1 = open(batchnews,"uuspool:newsout","A")
  71. if ~result1 then open(batchnews,"uuspool:newsout","W")
  72. call seek(batchnews,0,"E")
  73. call writeln(batchnews,newnewsfile)
  74. call close(batchnews)
  75.  
  76. exit
  77.  
  78. insertfile2:
  79.   call open(file2,art2,"R")
  80.   do while ~eof(file2)
  81.     a = a + 1
  82.     line.a = readln(file2)
  83.     if word(line.a,1) == "X-NewsSoftware:" then line.a = "X-NewsSoftware: GRn 2.1 19/2/94 (PostNews Fix 31/3/95 Martin Hunt)"
  84.   end
  85.   alreadyinsertedfile = "TRUE"
  86.   call close(file2)
  87. RETURN
  88.  
  89. Signature:
  90. parse var newsgroup title ": " name.1 "." name.2 "." name.3 "." name.4 "." name.5 "." name.6 "." name.7 "." name.8 "." name.9 "." name.10
  91. nameno = 1
  92. sigfile = "uunews:/"
  93. do while name.nameno ~== ""
  94.   sigfile = sigfile || name.nameno ||"/"
  95.   nameno = nameno + 1
  96. end
  97. sigfile = sigfile ||".sig"
  98. if open(sig,sigfile,"R") then
  99. do
  100.   do until eof(sig)
  101.     a = a + 1
  102.     line.a = readln(sig)
  103.   end
  104.   call close(sig)
  105.   sig = 1
  106. end
  107. return
  108.